package com.csk.zsk.compents.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import com.csk.zsk.commons.entity.IdEntity;
import com.google.common.collect.Lists;

@Entity
@Table(name = "VIDEO")
//此annoation为了截断对象的循环引用.
@JsonIgnoreProperties({ "videoItemList" })
public class Video extends IdEntity {

	private String tv_name;
	private String actor;
	private String director;
	private String tv_big_pic;
	private String ver_big_pic;
	private String sid;
	private String vid;
	private Integer tv_year;
	private String pid;
	private String tv_desc;
	private String main_actor;
	private Integer tv_set_total;
	private Integer tv_set_now;
	private String type;
	private String area;
	private Integer tv_order;
	private List<VideoItem> videoItemList = Lists.newArrayList();

	public String getTv_name() {
		return tv_name;
	}

	public void setTv_name(String tv_name) {
		this.tv_name = tv_name;
	}

	public String getActor() {
		return actor;
	}

	public void setActor(String actor) {
		this.actor = actor;
	}

	public String getDirector() {
		return director;
	}

	public void setDirector(String director) {
		this.director = director;
	}

	public String getTv_big_pic() {
		return tv_big_pic;
	}

	public void setTv_big_pic(String tv_big_pic) {
		this.tv_big_pic = tv_big_pic;
	}

	public String getVer_big_pic() {
		return ver_big_pic;
	}

	public void setVer_big_pic(String ver_big_pic) {
		this.ver_big_pic = ver_big_pic;
	}

	public String getSid() {
		return sid;
	}

	public void setSid(String sid) {
		this.sid = sid;
	}

	public String getVid() {
		return vid;
	}

	public void setVid(String vid) {
		this.vid = vid;
	}

	public Integer getTv_year() {
		return tv_year;
	}

	public void setTv_year(Integer tv_year) {
		this.tv_year = tv_year;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public String getTv_desc() {
		return tv_desc;
	}

	public void setTv_desc(String tv_desc) {
		this.tv_desc = tv_desc;
	}

	public String getMain_actor() {
		return main_actor;
	}

	public void setMain_actor(String main_actor) {
		this.main_actor = main_actor;
	}

	public Integer getTv_set_total() {
		return tv_set_total;
	}

	public void setTv_set_total(Integer tv_set_total) {
		this.tv_set_total = tv_set_total;
	}

	public Integer getTv_set_now() {
		return tv_set_now;
	}

	public void setTv_set_now(Integer tv_set_now) {
		this.tv_set_now = tv_set_now;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getArea() {
		return area;
	}

	public void setArea(String area) {
		this.area = area;
	}

	public Integer getTv_order() {
		return tv_order;
	}

	public void setTv_order(Integer tv_order) {
		this.tv_order = tv_order;
	}

	@OneToMany(mappedBy = "video", cascade = { CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST }, fetch = FetchType.LAZY, orphanRemoval = true)
	@Fetch(FetchMode.SUBSELECT)
	@OrderBy(value = "video_order ASC")
	public List<VideoItem> getVideoItemList() {
		return videoItemList;
	}

	public void setVideoItemList(List<VideoItem> videoItemList) {
		this.videoItemList = videoItemList;
	}

}
